home *** CD-ROM | disk | FTP | other *** search
-
-
-
- bbbbuuuuffffccccaaaallllllll((((DDDD3333)))) bbbbuuuuffffccccaaaallllllll((((DDDD3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- _bbbb_uuuu_ffff_cccc_aaaa_llll_llll - call a function when a buffer becomes available
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
- _tttt_oooo_iiii_dddd______tttt _bbbb_uuuu_ffff_cccc_aaaa_llll_llll_((((_uuuu_iiii_nnnn_tttt______tttt _s_i_z_e_,,,, _iiii_nnnn_tttt _p_r_i_,,,, _vvvv_oooo_iiii_dddd _((((_****_f_u_n_c_))))_((((_))))_,,,, _llll_oooo_nnnn_gggg _a_r_g_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _s_i_z_e
- Number of bytes in the buffer to be allocated (from the failed
- _aaaa_llll_llll_oooo_cccc_bbbb(D3) request).
-
- _p_r_iPriority of the _aaaa_llll_llll_oooo_cccc_bbbb allocation request.
-
- _f_u_n_c
- Function or driver routine to be called when a buffer becomes
- available.
-
- _a_r_gArgument to the function to be called when a buffer becomes available.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- When a buffer allocation request fails, the function _bbbb_uuuu_ffff_cccc_aaaa_llll_llll can be used
- to schedule the routine, _f_u_n_c, to be called with the argument, _a_r_g, when
- a buffer of at least _s_i_z_e bytes becomes available. _bbbb_uuuu_ffff_cccc_aaaa_llll_llll serves, in
- effect, as a timeout call of indeterminate length.
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- On success, _bbbb_uuuu_ffff_cccc_aaaa_llll_llll returns a non-zero value that identifies the
- scheduling request. On failure, _bbbb_uuuu_ffff_cccc_aaaa_llll_llll returns 0.
-
- UUUUSSSSAAAAGGGGEEEE
- When _f_u_n_c runs, all interrupts from STREAMS devices will be blocked. On
- multiprocessor systems, when _f_u_n_c runs all interrupts from STREAMS
- devices will be blocked on the processor on which _f_u_n_c is running. _f_u_n_c
- will have no user context and may not call any function that sleeps.
-
- Even when _f_u_n_c is called, _aaaa_llll_llll_oooo_cccc_bbbb can still fail if another module or
- driver had allocated the memory before _f_u_n_c was able to call _aaaa_llll_llll_oooo_cccc_bbbb.
-
- The _p_r_i argument is no longer used but is retained for compatibility.
-
- The non-zero identifier returned by _bbbb_uuuu_ffff_cccc_aaaa_llll_llll may be passed to
- _uuuu_nnnn_bbbb_uuuu_ffff_cccc_aaaa_llll_llll(D3) to cancel the request.
-
- LLLLeeeevvvveeeellll
- Base or Interrupt.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- bbbbuuuuffffccccaaaallllllll((((DDDD3333)))) bbbbuuuuffffccccaaaallllllll((((DDDD3333))))
-
-
-
- SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
- Does not sleep.
-
- Driver-defined basic locks, read/write locks, and sleep locks may be held
- across calls to this function.
-
- EEEExxxxaaaammmmpppplllleeee
- The purpose of this service routine [see _ssss_rrrr_vvvv(D2)] is to add a header to
- all _MMMM______DDDD_AAAA_TTTT_AAAA messages. We assume only _MMMM______DDDD_AAAA_TTTT_AAAA messages are added to its
- queue. Service routines must process all messages on their queues before
- returning, or arrange to be rescheduled.
-
- While there are messages to be processed (line 19), we check to see if we
- can send the message on in the stream. If not, we put the message back
- on the queue (line 21) and return. The STREAMS flow control mechanism
- will re-enable us later when messages can be sent. If _cccc_aaaa_nnnn_pppp_uuuu_tttt(D3)
- succeeded, we try to allocate a buffer large enough to hold the header
- (line 24). If no buffer is available, the service routine must be
- rescheduled later, when a buffer is available. We put the original
- message back on the queue (line 26) and use _bbbb_uuuu_ffff_cccc_aaaa_llll_llll to attempt the
- rescheduling (lines 27 and 28). If _bbbb_uuuu_ffff_cccc_aaaa_llll_llll succeeds, we set the _mmmm______tttt_yyyy_pppp_eeee
- field in the module's private data structure to _BBBB_UUUU_FFFF_CCCC_AAAA_LLLL_LLLL. If _bbbb_uuuu_ffff_cccc_aaaa_llll_llll
- failed, we use _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt(D3) to reschedule us instead (line 30). _mmmm_oooo_dddd_cccc_aaaa_llll_llll
- will be called in about a half second [_dddd_rrrr_vvvv______uuuu_ssss_eeee_cccc_tttt_oooo_hhhh_zzzz_((((_5555_0000_0000_0000_0000_0000_))))]. When the
- rescheduling has been done, we return.
-
- When _mmmm_oooo_dddd_cccc_aaaa_llll_llll runs, it will set the _mmmm______tttt_yyyy_pppp_eeee field to zero, indicating that
- there is no outstanding request. Then the queue's service routine is
- scheduled to run by calling _qqqq_eeee_nnnn_aaaa_bbbb_llll_eeee(D3).
-
- If the buffer allocation is successful, we initialize the header (lines
- 37-39), make the message type _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO (line 41), link the _MMMM______DDDD_AAAA_TTTT_AAAA message
- to it (line 42), and pass it on (line 43).
-
- See _uuuu_nnnn_bbbb_uuuu_ffff_cccc_aaaa_llll_llll(D3) for the other half of this example.
-
- _1111 _ssss_tttt_rrrr_uuuu_cccc_tttt _hhhh_dddd_rrrr _{{{{
- _2222 _uuuu_iiii_nnnn_tttt______tttt _hhhh______ssss_iiii_zzzz_eeee_;;;;
- _3333 _iiii_nnnn_tttt _hhhh______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn_;;;;
- _4444 _}}}}_;;;;
- _5555 _ssss_tttt_rrrr_uuuu_cccc_tttt _mmmm_oooo_dddd _{{{{
- _6666 _llll_oooo_nnnn_gggg _mmmm______iiii_dddd_;;;;
- _7777 _cccc_hhhh_aaaa_rrrr _mmmm______tttt_yyyy_pppp_eeee_;;;;
- _...._...._....
- _8888 _}}}}_;;;;
- _9999 _####_dddd_eeee_ffff_iiii_nnnn_eeee _TTTT_IIII_MMMM_EEEE_OOOO_UUUU_TTTT _1111
- _1111_0000 _####_dddd_eeee_ffff_iiii_nnnn_eeee _BBBB_UUUU_FFFF_CCCC_AAAA_LLLL_LLLL _2222
- _...._...._....
- _1111_1111 _mmmm_oooo_dddd_ssss_rrrr_vvvv_((((_qqqq_)))) _////_**** _aaaa_ssss_ssss_uuuu_mmmm_eeee _oooo_nnnn_llll_yyyy _MMMM______DDDD_AAAA_TTTT_AAAA _mmmm_eeee_ssss_ssss_aaaa_gggg_eeee_ssss _eeee_nnnn_qqqq_uuuu_eeee_uuuu_eeee_dddd _hhhh_eeee_rrrr_eeee _****_////
- _1111_2222 _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
- _1111_3333 _{{{{
- _1111_4444 _mmmm_bbbb_llll_kkkk______tttt _****_bbbb_pppp_;;;;
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- bbbbuuuuffffccccaaaallllllll((((DDDD3333)))) bbbbuuuuffffccccaaaallllllll((((DDDD3333))))
-
-
-
- _1111_5555 _mmmm_bbbb_llll_kkkk______tttt _****_mmmm_pppp_;;;;
- _1111_6666 _ssss_tttt_rrrr_uuuu_cccc_tttt _hhhh_dddd_rrrr _****_hhhh_pppp_;;;;
- _1111_7777 _ssss_tttt_rrrr_uuuu_cccc_tttt _mmmm_oooo_dddd _****_mmmm_oooo_dddd_pppp_;;;;
- _1111_8888 _mmmm_oooo_dddd_pppp _==== _((((_ssss_tttt_rrrr_uuuu_cccc_tttt _mmmm_oooo_dddd _****_))))_qqqq_----_>>>>_qqqq______pppp_tttt_rrrr_;;;;
- _1111_9999 _wwww_hhhh_iiii_llll_eeee _((((_((((_mmmm_pppp _==== _gggg_eeee_tttt_qqqq_((((_qqqq_))))_)))) _!!!!_==== _NNNN_UUUU_LLLL_LLLL_)))) _{{{{
- _2222_0000 _iiii_ffff _((((_!!!!_cccc_aaaa_nnnn_pppp_uuuu_tttt_((((_qqqq_----_>>>>_qqqq______nnnn_eeee_xxxx_tttt_))))_)))) _{{{{
- _2222_1111 _pppp_uuuu_tttt_bbbb_qqqq_((((_qqqq_,,,, _mmmm_pppp_))))_;;;;
- _2222_2222 _rrrr_eeee_tttt_uuuu_rrrr_nnnn_;;;;
- _2222_3333 _}}}}
- _2222_4444 _bbbb_pppp _==== _aaaa_llll_llll_oooo_cccc_bbbb_((((_ssss_iiii_zzzz_eeee_oooo_ffff_((((_ssss_tttt_rrrr_uuuu_cccc_tttt _hhhh_dddd_rrrr_))))_,,,, _BBBB_PPPP_RRRR_IIII______MMMM_EEEE_DDDD_))))_;;;;
- _2222_5555 _iiii_ffff _((((_bbbb_pppp _====_==== _NNNN_UUUU_LLLL_LLLL_)))) _{{{{
- _2222_6666 _pppp_uuuu_tttt_bbbb_qqqq_((((_qqqq_,,,, _mmmm_pppp_))))_;;;;
- _2222_7777 _mmmm_oooo_dddd_pppp_----_>>>>_mmmm______iiii_dddd _==== _bbbb_uuuu_ffff_cccc_aaaa_llll_llll_((((_ssss_iiii_zzzz_eeee_oooo_ffff_((((_ssss_tttt_rrrr_uuuu_cccc_tttt _hhhh_dddd_rrrr_))))_,,,, _BBBB_PPPP_RRRR_IIII______MMMM_EEEE_DDDD_,,,,
- _2222_8888 _mmmm_oooo_dddd_cccc_aaaa_llll_llll_,,,, _((((_llll_oooo_nnnn_gggg_))))_qqqq_))))_;;;;
- _2222_9999 _iiii_ffff _((((_mmmm_oooo_dddd_pppp_----_>>>>_mmmm______iiii_dddd _====_==== _0000_)))) _{{{{
- _3333_0000 _mmmm_oooo_dddd_pppp_----_>>>>_mmmm______iiii_dddd _==== _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt_((((_mmmm_oooo_dddd_cccc_aaaa_llll_llll_,,,, _((((_llll_oooo_nnnn_gggg_))))_qqqq_,,,,
- _3333_1111 _dddd_rrrr_vvvv______uuuu_ssss_eeee_cccc_tttt_oooo_hhhh_zzzz_((((_5555_0000_0000_0000_0000_0000_))))_,,,, _pppp_llll_ssss_tttt_rrrr_))))_;;;;
- _3333_2222 _mmmm_oooo_dddd_pppp_----_>>>>_mmmm______tttt_yyyy_pppp_eeee _==== _TTTT_IIII_MMMM_EEEE_OOOO_UUUU_TTTT_;;;;
- _3333_3333 _}}}} _eeee_llll_ssss_eeee _{{{{
- _3333_4444 _mmmm_oooo_dddd_pppp_----_>>>>_mmmm______tttt_yyyy_pppp_eeee _==== _BBBB_UUUU_FFFF_CCCC_AAAA_LLLL_LLLL_;;;;
- _3333_5555 _}}}}
- _3333_6666 _rrrr_eeee_tttt_uuuu_rrrr_nnnn_;;;;
- _3333_7777 _}}}}
- _3333_8888 _hhhh_pppp _==== _((((_ssss_tttt_rrrr_uuuu_cccc_tttt _hhhh_dddd_rrrr _****_))))_bbbb_pppp_----_>>>>_bbbb______wwww_pppp_tttt_rrrr_;;;;
- _3333_9999 _hhhh_pppp_----_>>>>_hhhh______ssss_iiii_zzzz_eeee _==== _mmmm_ssss_gggg_dddd_ssss_iiii_zzzz_eeee_((((_mmmm_pppp_))))_;;;;
- _4444_0000 _hhhh_pppp_----_>>>>_hhhh______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn _==== _1111_;;;;
- _4444_1111 _bbbb_pppp_----_>>>>_bbbb______wwww_pppp_tttt_rrrr _++++_==== _ssss_iiii_zzzz_eeee_oooo_ffff_((((_ssss_tttt_rrrr_uuuu_cccc_tttt _hhhh_dddd_rrrr_))))_;;;;
- _4444_2222 _bbbb_pppp_----_>>>>_bbbb______dddd_aaaa_tttt_aaaa_pppp_----_>>>>_dddd_bbbb______tttt_yyyy_pppp_eeee _==== _MMMM______PPPP_RRRR_OOOO_TTTT_OOOO_;;;;
- _4444_3333 _bbbb_pppp_----_>>>>_bbbb______cccc_oooo_nnnn_tttt _==== _mmmm_pppp_;;;;
- _4444_4444 _pppp_uuuu_tttt_nnnn_eeee_xxxx_tttt_((((_qqqq_,,,, _bbbb_pppp_))))_;;;;
- _4444_5555 _}}}}
- _4444_6666 _}}}}
- _4444_7777 _mmmm_oooo_dddd_cccc_aaaa_llll_llll_((((_qqqq_))))
- _4444_8888 _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
- _4444_9999 _{{{{
- _5555_0000 _ssss_tttt_rrrr_uuuu_cccc_tttt _mmmm_oooo_dddd _****_mmmm_oooo_dddd_pppp_;;;;
- _5555_1111 _mmmm_oooo_dddd_pppp _==== _((((_ssss_tttt_rrrr_uuuu_cccc_tttt _mmmm_oooo_dddd _****_))))_qqqq_----_>>>>_qqqq______pppp_tttt_rrrr_;;;;
- _5555_2222 _mmmm_oooo_dddd_pppp_----_>>>>_mmmm______tttt_yyyy_pppp_eeee _==== _0000_;;;;
- _5555_3333 _qqqq_eeee_nnnn_aaaa_bbbb_llll_eeee_((((_qqqq_))))_;;;;
- _5555_4444 _}}}}
-
- RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
- _aaaa_llll_llll_oooo_cccc_bbbb(D3), _eeee_ssss_bbbb_aaaa_llll_llll_oooo_cccc(D3), _eeee_ssss_bbbb_bbbb_cccc_aaaa_llll_llll(D3), _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt(D3), _uuuu_nnnn_bbbb_uuuu_ffff_cccc_aaaa_llll_llll(D3)
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-